package com.ctshk.rpc.train.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ctshk.rpc.train.dto.TrainProductCostPriceDTO;
import com.ctshk.rpc.train.entity.TrainProducCostPrice;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 火车票成本价格表 Mapper 接口
 * </p>
 *
 * @author 彭柳霖
 * @since 2021-03-11
 */
public interface TrainProducCostPriceMapper extends BaseMapper<TrainProducCostPrice> {

    /**
     * 根据产品成本id查询产品成本价格集合
     * @param trainProductCostId
     * @return
     */
    @Select("<script>"+"select id,cost_id,boarding_station_id,s1.boarding_station_name,s1.alighting_station_id, \n" +
            "s1.alighting_station_name,s1.passenger_id,s1.passenger_name,s1.price,s1.number from t_train_product_cost_price s1 \n"+
            "where s1.cost_id = #{trainProductCostId} \n" +
            "</script>")
    List<TrainProductCostPriceDTO> queryList(@Param("trainProductCostId") Long trainProductCostId);

}
